package com.zero2oneblog.queue;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ArticlePublisher {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void publishArticle(String author, String article) {
        amqpTemplate.convertAndSend("article_exchange", author, article);
    }
}
